<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'edit';
$return=array();
if($_RQ['op']=='edit'){
	$item=$this->plugin_setting('basic');
	//$item['daohang']=json_encode($item['daohang'],true);
	$footernav = array(
			array('title'=>'首页','icon'=>'icon-shouye','color'=>'#cc99ff','action'=>'jy_baoming/index/','image'=>'../addons/jy_cms/resource/images/jy_cmsarticle.png'),
			array('title'=>'发布活动','icon'=>'icon-shangyi','color'=>'#66cc99','action'=>'jy_baoming/up/','image'=>'../addons/jy_cms/resource/images/jy_fenleimsg.png'),
			array('title'=>'我的订单','icon'=>'icon-manageorder','color'=>'#FF83FA','action'=>'jy_baoming/order/','image'=>'../addons/jy_cms/resource/images/jy_fenleimsg.png'),
			array('title'=>'会员中心','icon'=>'icon-wo1','color'=>'#FF83FA','action'=>'jy_baoming/myhome/','image'=>'../addons/jy_cms/resource/images/jy_fenleimsg.png'),
	);
	$item['footernav'] = !empty($item['footernav']) ? $item['footernav'] : $footernav;
    $return['item']=$item;
	$return['status']=array('1'=>'开启','0'=>'关闭');
	$htmls=array(
		'type'=>'edit',
		'post'=>'post',
		'desc'=>'系统设置',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基本参数',
				'list'=>array(
					array('type'=>'string','title'=>'网站名称','name'=>'title'),
					array('type'=>'image','title'=>'网站logo','name'=>'logo'),
					//array('type'=>'string','title'=>'【联系人】自定义','name'=>'nametitle'),
					array('type'=>'string','title'=>'分享标题','name'=>'share_title'),
					array('type'=>'image','title'=>'分享图片','name'=>'share_image'),
					array('type'=>'string','title'=>'分享描述','name'=>'share_desc'),
					array('type'=>'switch','title'=>'关闭会员中心我的发布？','name'=>'no_fa','isradio'=>1,'help'=>'关闭后，前端会员中心，不显示我的发票按钮！'),
					array('type'=>'switch','title'=>'关闭顶部返回？','name'=>'iscms','help'=>'关闭左上角会出现浮动返回门户按钮！'),
					array('type'=>'switch','title'=>'关闭已报名人数显示？','name'=>'no_sale','isradio'=>1,'help'=>'关闭后，活动列表，活动详情页不再显示！'),
					array('type'=>'switch','title'=>'关闭前端点击已完成','name'=>'is_receive','help'=>'关闭后，客户前端自己不能点已完成'),
					array('type'=>'switch','title'=>'创建活动审核','name'=>'shenhe','help'=>''),
				)
			),
			array(
				'title'=>'幻灯片',
				'list'=>array(
				array('type'=>'array','name'=>'hdps','add_tip'=>'添加一个幻灯片',
				'list'=>array(
					array('type'=>'image','name'=>'image','title'=>'幻灯片'),	
					array('type'=>'string','name'=>'url','title'=>'幻灯片url'),	
				),
				'details'=>array(
					array('type'=>'image','name'=>'image','title'=>'幻灯片'),	
					array('type'=>'string','name'=>'url','title'=>'幻灯片url'),
				)
				),
				)
			),
			array(
					'title'=>'欢迎幻灯片',
					'list'=>array(
								array('type'=>'switch','title'=>'开启欢迎页面','name'=>'iswelcome','help'=>'开启后，访问首页会先进入欢迎页面！'),
								array('type'=>'array','title'=>'欢迎幻灯片','name'=>'welcomehdps','add_tip'=>'添加一个欢迎幻灯片',
										'list'=>array(
											array('type'=>'string','name'=>'title','title'=>'标题'),
											array('type'=>'image','name'=>'picurl','title'=>'图片'),
											array('type'=>'string','name'=>'url','title'=>'地址'),
										),
										'details'=>array(
											array('type'=>'string','name'=>'title','title'=>'标题'),
											array('type'=>'string','name'=>'desc','title'=>'描述'),
											array('type'=>'image','name'=>'picurl','title'=>'图片','help'=>'推荐尺寸：750*900'),
											array('type'=>'link','name'=>'url','from'=>'action','title'=>'地址'),
										)
								),
					)
			),
			array(
					'title'=>'退款设置',
					'list'=>array(
						array('type'=>'switch','title'=>'支持退款？','name'=>'refundopen'),
					)
			),
			array(
							'title'=>'底部导航',
							'list'=>array(
								array('type'=>'array','name'=>'footernav','add_tip'=>'添加一个底部导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),	
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
									)
								),
							)
				),
			),
	);
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='post'){
	$postdata=get_postdata();
	$item=$this->plugin_setting('basic',$postdata);
	exi('设置成功');
}
?>